<?php 

if (Module::isInstalled('vs_fblogin')) {
	require_once(_PS_ROOT_DIR_.'/modules/vs_fblogin/vs_fblogin.php');	
}

class Cart extends CartCore
{

	public function getDiscounts($lite = false, $refresh = false)
	{
		if(class_exists("Vs_FbLogin")) {
			$customer = new Customer((int)($this->id_customer));
	
			if($customer->id_default_group == Vs_FbLogin::DEFAULT_GROUP &&
					$this->getDiscountsCustomer(Vs_FbLogin::DISCOUNT_ID) < 2)
			{
				$this->addDiscount(Vs_FbLogin::DISCOUNT_ID);
			}
		}
	
		return parent::getDiscounts($lite, $refresh);
	}
};

